﻿using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using MongoDB.Bson;

namespace MongoScienceDAL.Core.Tests
{
    [TestClass]
    public class ObjectIdExtensionMethodTests
    {
        [TestMethod]
        public void ObjectIdConversionIsReversable()
        {
            var objectId = ObjectId.GenerateNewId();

            var webString = objectId.ToWebString();

            var newObjectId = webString.ToObjectId();

            Assert.AreEqual(newObjectId, objectId);
        }
    }
}
